/*
GANESHA - Reasoning on critical infrastructures affected by emergency situations
Copyright (c) 2010-2011, Information Eng. Research Unit - Univ. of Alcala
http://www.cc.uah.es/ie
This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 2.1 of the License, or (at your option)
any later version.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
You should have received a copy of the GNU Lesser General Public License along
with this library; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */
package es.uah.cc.ie.ganesha.nodes;

/**
 * Class that represents a critical node.
 * @author ieru
 */
public class NodeInfo {

	String _id;
	String _name;
	double _lat, _long;
	String _domain;

	/**
	 * Returns identifier
	 * @return Identifier
	 */
	public String getId() {
		return _id;
	}

	/**
	 * Sets identifier
	 * @param _id Identifier
	 */
	public void setId(String _id) {
		this._id = _id;
	}

	/**
	 * Returns latitude
	 * @return Latitude
	 */
	public double getLat() {
		return _lat;
	}

	/**
	 * Sets latitude
	 * @param _lat Latitude
	 */
	public void setLat(double _lat) {
		this._lat = _lat;
	}

	/**
	 * Returns longitude
	 * @return Longitude
	 */
	public double getLon() {
		return _long;
	}

	/**
	 * Sets longitude
	 * @param _long Longitude
	 */
	public void setLon(double _long) {
		this._long = _long;
	}

	/**
	 * Returns name
	 * @return Name
	 */
	public String getName() {
		return _name;
	}

	/**
	 * Sets name
	 * @param _name Name
	 */
	public void setName(String _name) {
		this._name = _name;
	}

	/**
	 * Returns domain
	 * @return Domain
	 */
	public String getDomain() {
		return _domain;
	}

	/**
	 * Sets domain
	 * @param _domain Domain
	 */
	public void setDomain(String _domain) {
		this._domain = _domain;
	}

	/**
	 * Returns a string describing the node.
	 * @return String describing the node.
	 */
	@Override
	public String toString() {
		return _name + " de " + _domain + " (" + _lat + ", " + _long + ")";
	}

	@Override
	@SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
	public boolean equals(Object obj) {
		NodeInfo other = (NodeInfo) obj;

		return other._name.equals(_name) && other._id.equals(_id) && other._domain.equals(_domain)
				&& other._lat == _lat && other._long == _long;
	}


}
